Skip to content

Glasgow | 25-SDC-Nov | Nataliia Volkova | Sprint 2 | Implement a linked list in Python#108

Open
Nataliia74 wants to merge 1 commit intoCodeYourFuture:mainfrom
Nataliia74:linkedList
Open

Glasgow | 25-SDC-Nov | Nataliia Volkova | Sprint 2 | Implement a linked list in Python#108
Nataliia74 wants to merge 1 commit intoCodeYourFuture:mainfrom
Nataliia74:linkedList

Conversation

@Nataliia74
Copy link

@Nataliia74 Nataliia74 commented Feb 16, 2026

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

Issue: Implement a linked list in Python 9

@Nataliia74 Nataliia74 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 16, 2026
Comment on lines +40 to +43
if self.head is None:
return
if self.tail is None:
return None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you simplify the code on lines 40-43?

self.tail = node.previous
self.tail.next = None
node.previous = None
node.next = None
Copy link

@cjyuan cjyuan Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the value of node.next before line 53?

Comment on lines +46 to +52
if node.previous is None:
self.head = None
self.tail = None
else:
self.tail = node.previous
self.tail.next = None
node.previous = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also just call remove(node) -- less code to maintain.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants